package vo;

import java.util.List;

import logic.utility_logic.NoSuchElementException;
import po.SubModelPO;

public class SubModelVO {
	SubModelPO subModel;
	List<CourseVO> courseList;
	
	public SubModelVO(SubModelPO subModel, List<CourseVO> courseList) {
		super();
		this.subModel = subModel;
		this.courseList = courseList;
	}
	public List<CourseVO> getCourseList() {
		return courseList;
	}
	public String getSubModelID(){
		return subModel.getSubModelID();
	}
	public String getCategory(){
		return subModel.getCategory();
	}
	public String getName(){
		return subModel.getName();
	}
	public int getHeadSemester(){
		return subModel.getHeadSemester();
	}
	public int getTailSemester(){
		return subModel.getTailSemester();
	}
	public int getSubModelHeadCredit(){
		return subModel.getSubModelHeadCredit();
	}
	public int getSubModelTailCredit(){
		return subModel.getSubModelTailCredit();
	}
	public SubModelPO getSubModel() {
		return subModel;
	}
	public CourseVO getCourse(String courseID){
		for(CourseVO cv : courseList){
			if(cv.getCourseID().equals(courseID)){
				return cv;
			}
		}
		throw new NoSuchElementException();
	}
	@Override
	public String toString() {
		return "SubModelVO [subModel=" + subModel + ", courseList="
				+ courseList + "]";
	}
	
}
